import java.util.HashMap;
import java.util.Map;

public class Leetcode432 {
    Map<String, Integer> map;
    Pair max;
    Pair min;

    class AllOne {

        public AllOne() {
            map = new HashMap<>();
        }

        public void inc(String key) {
            int count = map.getOrDefault(key, 0) + 1;
            map.put(key, count);
            if (max == null || count > max.v) {
                max = new Pair(key, count);
            }

            if (min == null || count < min.v) {
                min = new Pair(key, count);
            }
        }

        public void dec(String key) {
            int count = map.get(key) - 1;
            if (count == 0) {
                
            }
        }

        public String getMaxKey() {
            return max.k;
        }

        public String getMinKey() {
            return min.k;
        }
    }

    class Pair {
        String k;
        Integer v;

        public Pair() {

        }

        public Pair(String k, Integer v) {
            this.k = k;
            this.v = v;
        }
    }

}
